Skip to content

DEV-1115 Exclude JNA from the driver on Android - #127

Merged
JongChern merged 2 commits into
DEV-1115_release_workflowfrom
DEV-1115_exclude_jna
Oct 19, 2026
Merged

JongChern merged 2 commits into
DEV-1115_release_workflowfrom
DEV-1115_exclude_jna

Conversation

@MAzalya

@MAzalya MAzalya commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Found while checking #123 against the new driver. This PR targets DEV-1115_release_workflow, so merging it folds the fix into #123.

The problem

A release with the driver box left blank now picks 0.11.9_beta. Against that driver, every example app fails packaging, so the release would stop at "Build every example against the chosen driver". It stops before anything is published, so that step did its job.

Execution failed for task ':bluetoothManagerExample:mergeDebugJavaResource'.
> 2 files found with path 'META-INF/AL2.0' from inputs:
   - .../net.java.dev.jna/jna-platform/5.18.1/.../jna-platform-5.18.1.jar
   - .../net.java.dev.jna/jna/5.18.1/.../jna-5.18.1.jar

All 11 apps fail this way; only the library builds. #123's CI and dry runs never saw it, because they build against master's default driver, 0.11.7_beta.

shimmerdriver gained jna and jna-platform 5.18.1 in April (ShimmerResearch/Shimmer-Java-Android-API@97bd44ab), for the desktop USB debug listeners (UsbDebugListenerWindows / UsbDebugListenerMacOS). Every driver from 0.11.8_beta on carries them. Android never built against 0.11.8_beta, because its shimmerbluetoothmanager was never published.

Fix

Exclude net.java.dev.jna from both driver dependencies in the root build.gradle, as io.netty already is. JNA is desktop-only, and nothing on Android loads those classes.

Tested locally (JDK 17, Gradle 8.5, -Xmx4g)

  • Before the fix, with -PdriverVersion=0.11.9_beta: 11 of 12 modules fail, as above.
  • After the fix, with -PdriverVersion=0.11.9_beta: the release .aar and assembleDebug in all 12 modules build.
  • After the fix, with the default driver 0.11.7_beta: all 12 modules still build.

For the release notes

The published .aar's POM lists no dependencies, so apps add the driver themselves. Apps using driver 0.11.8_beta or later will need the same exclude group: 'net.java.dev.jna'. It would be worth adding a line about it to the release notes the workflow writes.

🤖 Generated with Claude Code

shimmerdriver gained net.java.dev.jna:jna and jna-platform 5.18.1 in
April (97bd44ab in Shimmer-Java-Android-API) for the desktop USB debug
listeners, and 0.11.8_beta onwards carries them. Android had only ever
built against 0.11.7_beta, so nothing saw it until now: against
0.11.9_beta every app fails packaging with "2 files found with path
'META-INF/AL2.0'" from the two JNA jars. A release with the driver box
blank would stop at "Build every example against the chosen driver".

JNA is desktop-only and nothing on Android loads those classes, so
exclude it, as io.netty already is.

Checked locally (JDK 17): with -PdriverVersion=0.11.9_beta the release
.aar and assembleDebug in all 12 modules build; with the default driver
(0.11.7_beta) all 12 still build.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings October 19, 2026 02:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Add JNA exclusion guidance to the generated release notes or consumer documentation.

1 open issue
What changed in this PR

This pull request prevents Android packaging conflicts with newer drivers by excluding desktop-only JNA dependencies.

Changes:

  • Excludes net.java.dev.jna from both driver dependencies.
File Description
ShimmerAndroidInstrumentDriver/​build.gradle Adds JNA exclusions for Android builds.

Review effort: Lite

Excluding JNA in this repo's build.gradle does not reach apps that
consume the published .aar: its POM lists no dependencies, so they add
the driver themselves and would hit the same META-INF/AL2.0 clash with
driver 0.11.8_beta or later. The generated notes now say to exclude
net.java.dev.jna and link the exclusions this library builds with.
Raised by the Copilot review on #127.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings October 19, 2026 03:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No blocking issues were identified; the remaining release-note wording concern is minor.

1 open issue

Review effort: Lite

@JongChern
JongChern merged commit 41c14f3 into DEV-1115_release_workflow Oct 19, 2026
4 checks passed
@JongChern
JongChern deleted the DEV-1115_exclude_jna branch October 19, 2026 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants